import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;

/**
 *  GarageDoor Test for the Opening State
 *  
 * Created on:
 * 05.12.2006
 * 11:37:24
 * 
 * @author alaak
 * 
 * Modified
 * 17.01.08
 * 11:07:00
 * 
 * 31.01.08
 * 15:39
 * 
 * @author koschka
*/

public class GaragentorOeffnendTest extends BasicTest {
	
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		super.setUp();
		
		gd.openDoor();
	}

	/**
	 * Test method for {@link Garagentor#tasteZu()}.
	 */
	@Test
	public void testPressingCloseDoor() {
		gd.closeDoor();
		
		assertEquals("While pressing the Key closeDoor in opening state the gate should start closing again!",
					gd.new Closing().getClass(),getState().getClass());
		
		
		// old stuff
		//assertEquals("While pressing ZU in opening state the motor should rotate downwards!",mt.new Abwaerts().getClass(),gt.holeMotor().aktuellerZustand().getClass());
	}

	/**
	 * Test method for {@link Garagentor#tasteAuf()}.
	 */
	@Test
	public void testPressingOpenDoor() {
		gd.openDoor();
		
		assertEquals("While pressing the Key openDoor in opening state the gate should continue opening!",
				gd.new Opening().getClass(),getState().getClass());
		
		// old stuff
		//assertEquals("While pressing AUF in opening state the motor should rotate upwards!",mt.new Aufwaerts().getClass(),gt.holeMotor().aktuellerZustand().getClass());
	}

	/**
	 * Test method for {@link Garagentor#anschlag()}.
	 */
	@Test
	public void testAnschlag() {
		gd.stopper();
		
		assertEquals("Getting the endsignal in opening state the gate should have been opened!",
				gd.new Open().getClass(),getState().getClass());
		
		// old stuff
		//assertEquals("Getting the endsignal the motor should be off!",mt.new Aus().getClass(),gt.holeMotor().aktuellerZustand().getClass());
	}

}